package com.proxy.common.pool;

import java.util.concurrent.TimeUnit;

/**
 * 未被使用的队列接口
 *
 * Created by liufish on 17/1/27.
 */
public interface IdleObjectQueue<T> {


    PoolObject<T> poll(long timeout, TimeUnit unit);


    PoolObject<T> poll();


    boolean offer(PoolObject<T> poolObject);


    int getIdleObjectsCount();


    void clear();

    void remove(PoolObject<T> poolObject);


    void iterators(PoolCallback<T> callback);


    interface PoolCallback<T> {
        void call(PoolObject<T> object);
    }
}